package com.cn.springcloudwechat.service.find.communication;

import com.cn.springcloudwechat.common.mybatis.Page;
import com.cn.springcloudwechat.model.YmAnswer;
import com.cn.springcloudwechat.model.YmPraise;
import com.cn.springcloudwechat.model.attachment.YmAttachment;
import com.cn.springcloudwechat.model.attachment.YmAttachmentRelevance;
import com.cn.springcloudwechat.model.find.communication.YmAnswerVO;
import com.cn.springcloudwechat.model.find.communication.YmExchange;
import com.cn.springcloudwechat.model.find.communication.YmExchangeVO;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

public interface CommunicationService {

    /**
     * 交流圈-发帖
     * @param ymExchange
     * @return
     */
    public Long insertExchange(YmExchange ymExchange);

    /**
     * 交流圈-帖子列表
     * @return
     */
    public Page<YmExchangeVO> quertYmExchangeList(Page<YmExchangeVO> page,YmExchangeVO ymExchangeVO);

    /**
     * 交流圈-修改点赞
     * @return
     */
    public Integer updatePraiseByUserIdAndTypeId(YmPraise ymPraise);

    /**
     * 交流圈-是否已点过赞
     * @param ymPraise
     * @return
     */
    public Integer praiseExist(YmPraise ymPraise);

    /**
     * 交流圈-新增点赞
     * @param ymPraise
     * @return
     */
    public Integer addPraise(YmPraise ymPraise);

    /**
     * 交流圈-评论回复
     * @param ymAnswer
     * @return
     */
    public Integer insertAnser(YmAnswer ymAnswer,int type);

    /**
     * 交流圈-主贴回复列表
     * @return
    */
    public List<YmAnswerVO>queryYmAnswerList(Long exchangeId,Integer type);

    /**
     * 交流圈-帖子回复详情
     * @param typeId
     * @return
     */
    public List<YmAnswerVO>queryYmAnswerDetail(Long typeId,Integer type);

    /**
     * 点赞数
     * @param record
     * @return
     */
    public Integer praiseCount(YmPraise record);

    /**
     * 交流圈-添加帖子图片附件
     * @param ymAttachments
     */
    public Integer insertAttachment(String[] ymAttachments,Long relevanceId);

    /**
     * 根据类型和业务id查询附件
     *
     *  业务类型名称(1文章2问医生3交流圈4头像5课程6课程包7图文中的图片)
     * @return
     */
    public List<YmAttachment> selectByRelevanceIdAndType(YmAttachmentRelevance ymAttachmentRelevance);

    /**
     * 帖子内容详情
     * @param exchangeId
     * @return
     */
    public YmExchangeVO selectByPrimaryKey(Long exchangeId);


    /**
     * 删除帖子
     * @param exchangeId
     * @return
     */
    public Integer deleteExchangeByExchangeId(String [] exchangeId, String state);
    /**
     * 删除评论
     * @param answerId
     * @return
     */
    public Integer deleteAnswerByAnswerId(String [] answerId);

    /**
     * 交流圈-帖子列表-后台
     * @return
     */
    public  Page<YmExchangeVO> quertYmExchangeListMrg(YmExchangeVO ymExchangeVO, Page<YmExchangeVO> page);

    /**
     * 交流圈-帖子详情-后台管理
     * @return
     */
    public Page<YmAnswerVO> quertCommunicationDetailMrg(YmExchangeVO ymExchangeVO,Page<YmAnswerVO> page);

    /**
     * 今天用户点赞的数量
     * @param ymPraise
     * @return
     */
    public Integer todayPraiseCount(YmPraise ymPraise);

    /**
     * 修改帖子排序类型
     * 类型排序 0官方 1热门 2推荐 3普通
     * @return
     */
    public Integer updateTypeOrder(String [] exchangeId,String [] typeOrder);

    /**
     * 后台管理-帖子详情
     * @param ymExchangeVO
     * @return
     */
    public YmExchangeVO quertExchangenDetailMrg(YmExchangeVO ymExchangeVO);

}
